/**
 * 打印界面，流程基础信息
*/
import { useUpdate } from "ahooks";
import { useForm } from "../framework/common/context/metadata-context";
import { useSubscribe } from "../framework/common/eventBus";
import "./index.css";

export default function () {
  const { data: tplData } = useForm();
  let updater = useUpdate();
  
  useSubscribe("updatePrintProcessBaseInfo.update", ()=>{
    updater();
  },[]);

  //打印内容设置-未开启流程标题
  if(!tplData?.printSetting?.printProcessTitle){
    return null;
  }
  
  //流程标题未勾选
  if(tplData.hideInfo.show_process_title != true){
    return null;
  }

  return <>
          <div className="font-bold mb-10px">基础信息</div>
          <table className="table-approveOpinion w-full mb-10px">
            <tbody>
              <tr>
                <td className="px-5px py-2px w-80px">流程标题</td>
                <td className="px-5px py-2px" dangerouslySetInnerHTML={{__html:tplData.ProcessInfo.Title}}></td>
              </tr>
            </tbody>
          </table>
        </>
}
